﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Snowdreamist.ComponentModel.Composition.Navigation;
using Snowdreamist.ComponentModel.Plugin;
using Snowdreamist.Windows.Navigation;

namespace Snowdreamist.ComponentModel.MEF.Navigation
{
    public class MEFNavigationHandlerRepository
    {
        private static readonly ImportedPluginProperty<INavigationHandler, INavigationHandlerMetadata> NavigationHandlersProperty
            = ImportedPluginProperty.Create<INavigationHandler, INavigationHandlerMetadata>(new ContractMetadata(
                    new Guid("7DE7BC26-6620-46F7-A2B1-CC36CF79005B"), null, typeof(INavigationHandler), CandidateMode.ZeroOrMore, typeof(MEFNavigationHandlerRepository)
                ));

        public IEnumerable<ImportedPlugin<INavigationHandler, INavigationHandlerMetadata>> NavigationHandlers
        {
            get
            {
                return NavigationHandlersProperty.GetValuesWithMetadata(this);
            }
        }
    }
}